<?php use_stylesheet('terminal.css') ?>
<?php use_stylesheet('options.css') ?>

<h2>
    <a href="<?= url_for('terminal/show?id='.$tu->getId()) ?>">
        <img class="ptt" src="<?= ICON_FLECHE_DROITE ?>" alt="aller" title="Retour à la fiche du TU" />
    </a> <?= $tu->getName() ?>
</h2>
<h3>
    <a href="<?= url_for('tests/index?id='.$tu->getId()) ?>">
        <img class="ptt" src="<?= ICON_RELOAD ?>" alt="reload" title="Recharger la page" />
    </a> Tests (index.test.php)
</h3>
<?php foreach ($tb_opt_categ as $categ): ?>
<?php $tb_opt = $categ->getOptions($tu->getId()) ?>
<table style="margin:0px;">
    <thead>
        <tr>
            <th class="titreOption" name="<?= $categ->getId()?>">
                <span style="float:left;text-align:left;"><?= $categ->getName() ?></span>
            </th>
        </tr>
    </thead>
    <tbody class="bodyOption" id="<?= $categ->getId()?>">
    <?php foreach ($tb_opt as $i => $opt): ?>
    <tr class="<?= $i%2 == 0 ? "pair":"impair" ?>">
        <td><span style="float:left;text-align:left;"><?= $opt->getName() ?></span>
            <span style="float:right;text-align:right"><?= OptPeer::afOk($opt->getIsOk()) ?></span>
            <?php if (! $opt->getIsOk()): ?>
            <br />
            <img class="ptt" src="<?= ICON_WARNING ?>" alt="erreur" /> <?= $opt->getError() ?>
            <?php endif; ?>
        </td>
    </tr>
    <?php endforeach; ?>
    </tbody>
</table>
<?php endforeach; ?>